﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;
namespace ModuleConfig
{
    public class Numeric : INotifyPropertyChanged
    {
        public Numeric()
        { }

        public Numeric(int minv, int maxv, int v)
        {
            _min = minv;
            _max = maxv;
            _numbvalue = v;
        }

        private int _numbvalue = 0;
        public int numbvalue
        {
            get { return _numbvalue; }
            set
            {
                if (_numbvalue != value)
                {
                    _numbvalue = value;
                    NotifyPropertyChanged("numbvalue");
                }
            }
        }

        private int _min = -32768;
        public int min
        {
            get { return _min; }
            set
            {
                if (_min != value)
                {
                    _min = value;
                    NotifyPropertyChanged("min");
                }
            }
        }

        private int _max = 32767;
        public int max
        {
            get { return _max; }
            set
            {
                if (_max != value)
                {
                    _max = value;
                    NotifyPropertyChanged("max");
                }
            }
        }

        private void NotifyPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;
    }
}
